<?php
require(dirname(dirname(__FILE__)) . '/core.php');
?><!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>购物车列表</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="format-detection" content="telephone=no">
	<meta name="apple-mobile-web-app-capable" content="yes"/>
	<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
	<meta name="format-detection" content="telephone=no"/>
	<meta name="full-screen" content="yes"/>
	<meta name="browsermode" content="application"/>
	<!-- QQ强制竖屏 QQ强制全屏 -->
	<meta name="x5-orientation" content="portrait"/>
	<meta name="x5-fullscreen" content="true"/>
	<meta name="x5-page-mode" content="app"/>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" type="text/css" href="../css/reset.css">
	<link rel="stylesheet" type="text/css" href="../css/font-awesome.min.css">
	<link rel="stylesheet" type="text/css" href="../css/main.css">
	<link rel="stylesheet" type="text/css" href="../css/child.css">
	<script type="text/javascript" src="../js/zepto.min.js"></script>
	<script type="text/javascript" src="../js/config.js"></script>

	<script src='/wap/js/layer.m/layer.m.js'></script>
	<style>
		#bottom .nav {
			background: #444;
		}

		header, .header, .header-wrap {
			background: #f8f8f8;
		}

		.buy-num {
			height: 34px;
		}
	</style>
</head>
<body>
<header id="header"></header>
<div class="cart-list-wp">
	<div id="cart-list-wp"></div>

	<script type="text/html" id="cart-list">
		<% if(num > 0){%>
		<ul class="cart-list">
			<li id="checkall-wp">
				<input type="checkbox" id="checkall">全选
			</li>
			<% for (store_id in sort_cart_list){%>
				<li class="cart-list-item">
					<div class="cart-shop-name">
						<input type="checkbox" class="checked-store">店铺名称：<%= sort_cart_list[store_id].store_name%>
					</div>
					<% for (orderType in sort_cart_list[store_id].type_order_list) {%>

					<div>
						<%= orderType %>
					</div>

					<% sort_cart_list[store_id].type_order_list[orderType].forEach(function(goods){ %>



					<div class="cart-litem-wp clearfix">
						<input type="checkbox" class="cart-checked-id" cart_id="<%=goods.cart_id%>">
						<a class="cart-litemw-imgwp"
						   href="<%=WapSiteUrl%>/tmpl/product_detail.html?goods_id=<%=goods.goods_id%>">
							<img src="<%=goods.goods_image_url%>"/>
						</a>
						<div class="cart-litemw-cnt" cart_id="<%=goods.cart_id%>">
							<a class="cart-litemwc-pdname"
							   href="<%=WapSiteUrl%>/tmpl/product_detail.html?goods_id=<%=goods.goods_id%>">
								<%=goods.goods_name%>
							</a>
							<p class="mt5">
								单价：￥<%=goods.goods_price%>
								<% if(goods.goods_proxy < goods.goods_price && goods.goods_proxy){%>

								<% }%>


							</p>
							<% if(goods.open_tax == 1){%>
							<p class='mt5 tax'>
								行邮税：￥<em><%=goods.tax%></em>
							</p>
							<% }%>
							<p class="mt5">
								总价：￥<span class="goods-total-price"><%=goods.goods_sum%></span>
							</p>
							<p class="cart-litemwc-pdcount clearfix mt5">
                                        <span class="minus-wp fleft">
                                            <span class="i-minus"></span>
                                        </span>
								<input type="text" class="buy-num buynum fleft" value="<%=goods.goods_num%>"/>
							<span class="add-wp fleft">
                                            <span class="i-add"></span>
                                        </span>
							<div style="clear:both;"></div>
							</p>
						</div>
						<span class="cart-list-del" cart_id="<%=goods.cart_id%>">
							<span class="i-del"></span>
						</span>
					</div>

					<% })%>

					<% } %>
				</li>
				<%}%>

				<li class="cart-list-oitem mt10">
					商品总金额：<span class="clr-d94 total_price">￥<%=sum%></span>
				</li>

				<% if(bind_mobile){ %>
				<li>
					<a href="javascript:void(0)" class="goto-settlement mt10">去结算</a>
				</li>
				<% }else{ %>
				<li>
					<a href="/wap/tmpl/member/member_mobile_bind.php" class="bind-mobile mt10">请先绑定手机</a>
				</li>
				<% } %>

				<li>
					<a href="<%=WapSiteUrl%>/tmpl/product_list.html?gc_id=0" class="goto-shopping mt10">去逛逛</a>
				</li>
		</ul>
		<%}else{%>
		<div class="no-record m10">
			<style>
				img.cart {
					width: 5rem;
				}

				a.cart {
					display: block;
					padding: 0.5em 0;
					width: 15em;
					display: block;
					margin: 1em auto;
					font-size: 1.2em;
					border: none;
					background: #5babe6;
					color: #fff;
					border-radius: 4px;
				}
			</style>
			<img class='cart' src="/wap/tmpl/bangzi.png" alt="">
			<div style='color:#555;padding-top:20px;'>
				购物车什么都没有，赶快去购物吧
			</div>

			<a href="/wap/" class='cart'>去购物</a>
		</div>
		<%}%>
	</script>



<!--	<script type="text/html" id="cart-list">-->
<!--		<% if(cart_list.length >0){%>-->
<!--		<ul class="cart-list">-->
<!--			<% for (var i = 0;i-->
<!--			<cart_list.length-->
<!--			;i++){%>-->
<!--			<li class="cart-list-item">-->
<!--				<div class="cart-shop-name">-->
<!--					店铺名称：<%=cart_list[i].store_name%>-->
<!--				</div>-->
<!--				<div class="cart-litem-wp clearfix">-->
<!--					<a class="cart-litemw-imgwp"-->
<!--					   href="<%=WapSiteUrl%>/tmpl/product_detail.html?goods_id=<%=cart_list[i].goods_id%>">-->
<!--						<img src="<%=cart_list[i].goods_image_url%>"/>-->
<!--					</a>-->
<!--					<div class="cart-litemw-cnt" cart_id="<%=cart_list[i].cart_id%>">-->
<!--						<a class="cart-litemwc-pdname"-->
<!--						   href="<%=WapSiteUrl%>/tmpl/product_detail.html?goods_id=<%=cart_list[i].goods_id%>">-->
<!--							<%=cart_list[i].goods_name%>-->
<!--						</a>-->
<!--						<p class="mt5">-->
<!--							单价：￥<%=cart_list[i].goods_price%>-->
<!--							<% if(cart_list[i].goods_proxy < cart_list[i].goods_price && cart_list[i].goods_proxy){%>-->
<!--							-->
<!--							<% }%>-->
<!---->
<!---->
<!--						</p>-->
<!--						<% if(cart_list[i].open_tax == 1){%>-->
<!--						<p class='mt5 tax'>-->
<!--							行邮税：￥<em><%=cart_list[i].tax%></em>-->
<!--						</p>-->
<!--						<% }%>-->
<!--						<p class="mt5">-->
<!--							总价：￥<span class="goods-total-price"><%=cart_list[i].goods_sum%></span>-->
<!--						</p>-->
<!--						<p class="cart-litemwc-pdcount clearfix mt5">-->
<!--                                        <span class="minus-wp fleft">-->
<!--                                            <span class="i-minus"></span>-->
<!--                                        </span>-->
<!--							<input type="text" class="buy-num buynum fleft" value="<%=cart_list[i].goods_num%>"/>-->
<!--							<span class="add-wp fleft">-->
<!--                                            <span class="i-add"></span>-->
<!--                                        </span>-->
<!--						<div style="clear:both;"></div>-->
<!--						</p>-->
<!--					</div>-->
<!--				</div>-->
<!--				<span class="cart-list-del" cart_id="<%=cart_list[i].cart_id%>">-->
<!--                                <span class="i-del"></span>-->
<!--                            </span>-->
<!--			</li>-->
<!--			<%}%>-->
<!--			<li class="cart-list-oitem mt10">-->
<!--				商品总金额：<span class="clr-d94 total_price">￥<%=sum%></span>-->
<!--			</li>-->
<!--			<% if(bind_mobile){ %>-->
<!--				<li>-->
<!--					<a href="javascript:void(0)" class="goto-settlement mt10">去结算</a>-->
<!--				</li>-->
<!--			<% }else{ %>-->
<!--				<li>-->
<!--					<a href="/wap/tmpl/member/member_mobile_bind.php" class="bind-mobile mt10">请先绑定手机</a>-->
<!--				</li>-->
<!--			<% } %>-->
<!--			<li>-->
<!--				<a href="<%=WapSiteUrl%>/tmpl/product_list.html?gc_id=0" class="goto-shopping mt10">去逛逛</a>-->
<!--			</li>-->
<!--		</ul>-->
<!--		<%}else{%>-->
<!--		<div class="no-record m10">-->
<!--			<style>-->
<!--				img.cart {-->
<!--					width: 5rem;-->
<!--				}-->
<!---->
<!--				a.cart {-->
<!--					display: block;-->
<!--					padding: 0.5em 0;-->
<!--					width: 15em;-->
<!--					display: block;-->
<!--					margin: 1em auto;-->
<!--					font-size: 1.2em;-->
<!--					border: none;-->
<!--					background: #5babe6;-->
<!--					color: #fff;-->
<!--					border-radius: 4px;-->
<!--				}-->
<!--			</style>-->
<!--			<img class='cart' src="/wap/tmpl/bangzi.png" alt="">-->
<!--			<div style='color:#555;padding-top:20px;'>-->
<!--				购物车什么都没有，赶快去购物吧-->
<!--			</div>-->
<!---->
<!--			<a href="/wap/" class='cart'>去购物</a>-->
<!--		</div>-->
<!--		<%}%>-->
<!--	</script>-->
</div>
</div>
<?php
	require(dirname(BASE_PATH) . '/wap/simple_footer.php');
?>

<!-- 拆弹相关信息 -->
<script>
	var split_limit = '<?php echo $config['split_limit']?>';
	var open_tax = '<?php echo $config['open_tax']; ?>';
	var custom_name = '<?php echo $config['custom_interface']?>';
	var order_split = Number('<?php echo $config['order_split']?>');
	var manual_split = Number('<?php echo $config['manual_split']?>');

	//如果可以拆，直接在这就存了
	<?php
	if ($config['order_split'] == 1) {
		if ($config['manual_split'] == 0) {
			$_SESSION['want_split'] = 1;
		}
	}
	else {
		unset($_SESSION['want_split']);
	}
	?>
</script>

<div id="footer"></div>
<script type="text/javascript" src="../js/template.js"></script>
<script type="text/javascript" src="../js/common.js"></script>
<script type="text/javascript" src="../js/simple-plugin.js"></script>
<script type="text/javascript" src="../js/tmpl/common-top.js"></script>
<script type="text/javascript" src="../js/tmpl/footer.js"></script>
<script type="text/javascript" src="../js/tmpl/cart-list.js"></script>


</body>
</html>